import 'package:f200/system/index/views/index_scaffold_view.dart';
import 'package:flutter/material.dart';

class IndexView extends StatefulWidget {
  const IndexView({super.key});

  @override
  State<IndexView> createState() => _IndexViewState();
}

class _IndexViewState extends State<IndexView>
    with AutomaticKeepAliveClientMixin<IndexView>, WidgetsBindingObserver {
  @override
  Widget build(BuildContext context) {
    super.build(context);

    return const IndexScaffoldView();
  }

  @override
  bool get wantKeepAlive => true;

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    //通过state判断APP前后台切换
    if (state == AppLifecycleState.resumed) {
      debugPrint('App State=========切换到前台');
    } else if (state == AppLifecycleState.inactive) {
      debugPrint('App State=========失去焦点');
    }
    super.didChangeAppLifecycleState(state);
  }
}
